package com.kupurui.asteacher.adapter;

import android.content.Context;
import android.view.View;
import android.widget.TextView;

import com.android.frame.adapter.CommonAdapter;
import com.android.frame.adapter.ViewHolder;
import com.android.frame.ui.BaseActivity;
import com.kupurui.asteacher.R;
import com.kupurui.asteacher.bean.BindingAuditInfo;

import java.util.List;

/**
 * Created by Administrator on 2017/7/18.
 */

public class BindingAuditAdapter extends CommonAdapter<BindingAuditInfo> {

    BaseActivity activity;

    public BindingAuditAdapter(Context context, List<BindingAuditInfo> mList, int itemLayoutId) {
        super(context, mList, itemLayoutId);
        activity = (BaseActivity) context;
    }

    @Override
    public void convert(ViewHolder holder, final BindingAuditInfo item, int positon) {
        holder.setTextViewText(R.id.tv_student_name,"学生姓名："+item.getStudent());
        holder.setTextViewText(R.id.tv_school_name,"学校："+item.getSchool());
        holder.setTextViewText(R.id.tv_address,"所在位置："+item.getCity());
        holder.setTextViewText(R.id.tv_grade,"年级："+item.getGrade());
        holder.setTextViewText(R.id.tv_class_name,"班级："+item.getClass_name());

        TextView tvPass = holder.getView(R.id.tv_pass);
        TextView tvUnpass = holder.getView(R.id.tv_un_pass);


        tvPass.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                activity.intoActivity(item,0);
            }
        });

        tvUnpass.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                activity.intoActivity(item,1);
            }
        });



    }
}
